var closeButton = document.querySelector('.index-head-con .right i.icon-guanbi');
closeButton.addEventListener('click', function() {
	var indexHead = document.querySelector('.index-head');
	indexHead.style.display = 'none';
});

const items = document.querySelectorAll('.index-course .course-box .item');
items.forEach(item => {
	const switchBtn = item.querySelector('.switch');
	switchBtn.addEventListener('click', () => {
		const ul = item.querySelector('.course-sub');
		if (ul.style.display === 'none') {
			ul.style.display = 'block';
			switchBtn.innerHTML = '<i class="iconfont icon-up"></i>';
		} else {
			ul.style.display = 'none';
			switchBtn.innerHTML = '<i class="iconfont icon-down"></i>';
		}
	});
});

layui.use(function () {
	var carousel = layui.carousel;
	carousel.render({
		elem: '#banner',
		interval: 1800,
		anim: 'fade',
		width: '680px',
		height: 'auto',
		interval: '8000',
		indicator: 'none'
	});
});
var closeButton = document.querySelector('.wap-popup .box i.icon-guanbi');
closeButton.addEventListener('click', function() {
	var indexHead = document.querySelector('.wap-popup');
	indexHead.style.display = 'none';
});